<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-nested" prefix="nested" %>
<%@ taglib uri="/tags/radioanswers" prefix="radioanswers" %>

<%@ page import="net.lwf.handler.util.ImageHtml,net.lwf.handler.constant.IHandlerConstant"%>

<html:form action="/simplearray" >
	
	<table border="0" align="center" width="75%">
          <tr>
               <td>&nbsp;</td>
          </tr> 	
          
          <logic:equal name="saaform" property="askQuestion" value="false">
    <tr>
        <td>&nbsp;</td>
    </tr>             
       </logic:equal>
       
                         
       <logic:equal name="saaform" property="askQuestion" value="true">

       <tr>
           <td class="instructions_text">
           	<bean:write name="saaform" property="instructionText"/>
           </td>                 
       </tr>                    
       <tr>
           <td class="leftlabel">
                Question #: <bean:write name="saaform" property="questionNumber"/>
           </td>                 
       </tr>
       <tr>
           <td>&nbsp;</td>                 
       </tr>  
       <tr>
           <td align="center">
                <bean:define id="rowdata" name="saaform" property="dataarray.rows"/>
                <bean:define id="columndata" name="saaform" property="dataarray.columns"/>
                <table border="0">
                <%
                    int iRows = Integer.parseInt(rowdata.toString());
                    int iColumns = Integer.parseInt(columndata.toString());
                    String dotimage = ImageHtml.getDotImage();
                    for(int i=0; i<iRows; i++) {
                 %>
                      <tr>
                 <%
                        for(int j=0; j<iColumns; j++) {
                 %>
                       <td>
                            <%=dotimage%>
                       </td> 
                       <td>&nbsp;</td>     
                 <%
                        }
                 %>
                      </tr>
                 <%
                        }
                 %>
                 </table>
           </td>                 
       </tr>  
       <tr>
       	<td>
       	 	<fieldset>
       	 		<legend class="legend" align="left">Choose  <span> the answer </span></legend>
         	 	<radioanswers:display  onClick="checkAnswer('/simplearray.do?action=checkanswer')" rowsonly="true"/>
       	 	</fieldset>  
       	 </td>          
       </tr>                 
       <tr> 
           <td>&nbsp;</td>                 
       </tr>                  
       <tr>
           <td>
           	<table>
           		<tr>
           			<td class="rightlabel">
           				<img src="<%=request.getContextPath()%>/image/arrows/arrowright1.gif" border="0">&nbsp;&nbsp;
           				For the next sum, 
           			</td>
           			<td class="rightlabel">
                         click <a href="<%=request.getContextPath()%>/simplearray.do?action=generate">here</a>                     			
           			</td>
           		</tr>
           	</table>
           </td>                 
       </tr>    
       </logic:equal>     
	</table>  

</html:form>   
